package com.cloudlinkscm.base.authcenter.model.dto;

/**
 * Created by sin on 2017/7/27.
 *
 * access token
 *
 * <p>
 *     授权成功后的 token 信息
 * </p>
 */
public class AccessToken {

    /**
     * token
     */
    private String token;
    /**
     * cache 时间
     */
    private Long cacheSecond;
    /**
     * cache 开始时间
     */
    private Long cacheStartTime;
    /**
     * cache 到期时间
     */
    private Long cacheExpirationTime;

    public AccessToken() {
    }

    public AccessToken(String token, Long cacheSecond, Long cacheStartTime, Long cacheExpirationTime) {
        this.token = token;
        this.cacheSecond = cacheSecond;
        this.cacheStartTime = cacheStartTime;
        this.cacheExpirationTime = cacheExpirationTime;
    }

    public static AccessToken Build(String token, Long cacheSecond, Long cacheStartTime, Long cacheExpirationTime) {
        return new AccessToken(token, cacheSecond, cacheStartTime, cacheExpirationTime);
    }

    @Override
    public String toString() {
        return "AccessToken{" +
                "token='" + token + '\'' +
                ", cacheSecond=" + cacheSecond +
                ", cacheStartTime=" + cacheStartTime +
                ", cacheExpirationTime=" + cacheExpirationTime +
                '}';
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public Long getCacheSecond() {
        return cacheSecond;
    }

    public void setCacheSecond(Long cacheSecond) {
        this.cacheSecond = cacheSecond;
    }

    public Long getCacheStartTime() {
        return cacheStartTime;
    }

    public void setCacheStartTime(Long cacheStartTime) {
        this.cacheStartTime = cacheStartTime;
    }

    public Long getCacheExpirationTime() {
        return cacheExpirationTime;
    }

    public void setCacheExpirationTime(Long cacheExpirationTime) {
        this.cacheExpirationTime = cacheExpirationTime;
    }
}
